#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>

using namespace std;

class Solution
{
public:
    void hanota(vector<int>& a, vector<int>& b, vector<int>& c)
    {
        dfs(a, b, c, a.size());
    }

    void dfs(vector<int>& a, vector<int>& b, vector<int>& c, int num)
    {
        if (num == 1)
        {
            c.push_back(a.back());
            a.pop_back();
            return;
        }
        dfs(a, c, b, num - 1);
        c.push_back(a.back());
        a.pop_back();
        dfs(b, a, c, num - 1);
    }
};